#include "HL2ServerInfo.h"
#include "HLServerInfo.h"
#include "ServerInfo.h"
#include <new>
#include <iostream>
#include <stdlib.h>

using namespace std;

int main(int argc, char **argv)
{
	ServerInfo *srv = new HL2ServerInfo(argv[1]?argv[1]:"lixo.servegame.com", argv[2]?atoi(argv[2]):27015);
	//ServerInfo *srv = new HLServerInfo(argv[1]?argv[1]:"lixo.servegame.com",argv[2]?atoi(argv[2]): 27030);
	srv->update();
	map<string, string> info = srv->getAttributes();
	map<string, string>::iterator it;
	for(it = info.begin(); it != info.end(); it++) {
		cout << it->first << "=" << it->second << endl;
	}
	srv->updateRules();
	info = srv->getRules();
	cout << "Rules" << endl;
	for(it = info.begin(); it != info.end(); it++) {
		cout << "\t" << it->first << "=" << it->second << endl;
	}
	delete(srv);
	return 0;
}
